package com.muyu.system.mapper;

import com.muyu.system.domain.DanmoShoppingCart;
import com.muyu.system.domain.DanmoShoppingOrderCartDetails;
import com.muyu.system.domain.DanmoShoppingProducts;
import com.muyu.system.domain.DanmoShoppingProductsPicture;
import com.muyu.system.req.DanmoShoppingProductsPriceReq;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.PropertyValues;

import java.util.List;

/**
 * 商品Mapper接口
 *
 * @author yangle
 * @date 2024-09-29
 */
public interface DanmoShoppingProductsMapper
{
    /**
     * 查询商品
     *
     * @param productId 商品id
     * @return 商品
     */
    public DanmoShoppingProducts selectDanmoShoppingProductsById(@Param("productId") Long productId);

    /**
     * 查询商品列表
     *
     * @param danmoShoppingProducts 商品
     * @return 商品集合
     */
    public List<DanmoShoppingProducts> selectDanmoShoppingProductsList(DanmoShoppingProducts danmoShoppingProducts);

    /**
     * 新增商品
     *
     * @param danmoShoppingProducts 商品
     * @return 结果
     */
    public void insertDanmoShoppingProducts(DanmoShoppingProducts danmoShoppingProducts);

    /**
     * 修改商品
     *
     * @param danmoShoppingProducts 商品
     * @return 结果
     */
    public int updateDanmoShoppingProducts(DanmoShoppingProducts danmoShoppingProducts);

    /**
     * 删除商品
     *
     * @param id 商品主键
     * @return 结果
     */
    public int deleteDanmoShoppingProductsById(Long id);

    /**
     * 批量删除商品
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDanmoShoppingProductsByIds(Long[] ids);

    /**
     * 批量删除商品图片
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDanmoShoppingProductsPictureByProductIds(Long[] ids);

    /**
     * 批量新增商品图片
     *
     * @param danmoShoppingProductsPictureList 商品图片列表
     * @return 结果
     */
    public int batchDanmoShoppingProductsPicture(List<DanmoShoppingProductsPicture> danmoShoppingProductsPictureList);


    /**
     * 通过商品主键删除商品图片信息
     *
     * @param id 商品ID
     * @return 结果
     */
    public int deleteDanmoShoppingProductsPictureByProductId(Long id);

    List<DanmoShoppingProducts> selectPriceSort(DanmoShoppingProductsPriceReq danmoShoppingProductsPriceReq);

    List<DanmoShoppingProducts> salesSortList(DanmoShoppingProductsPriceReq danmoShoppingProductsPriceReq);

    List<DanmoShoppingProducts> commentsNumbersSort(DanmoShoppingProductsPriceReq danmoShoppingProductsCommentsNumbersReq);


    DanmoShoppingProducts getById(Long productId);


    void updateDanmoShoppingProduct(@Param("stock") Long stock, @Param("productId") Long productId, @Param("sales") Long sales);

    List<DanmoShoppingProducts> selectDanmoShoppingProductsByIds(@Param("ids") Long[] ids);

    DanmoShoppingProducts selectDanmoShoppingProductsAndSkuById(@Param("productId") Long productId,@Param("shoppingSkuId") Long shoppingSkuId);

    /**
     * 根据商品类型和子类型查询商品
     * @param categoryType
     * @param subcategoryType
     * @return
     */
    List<DanmoShoppingProducts> selectDanmoShoppingProductsByCategoryTypeAndSubcategoryType(@Param("categoryType") Long categoryType, @Param("subcategoryType") Long subcategoryType, @Param("productId") Long productId);

    /**
     * 根据商品id查询商品
     * @param productId
     * @return
     */
    DanmoShoppingProducts findById(@Param("productId") Long productId);

    /**
     * 根据商品id查询商品
     * @param productId
     */
    DanmoShoppingProducts selectDanmoShoppingProductsByOrderInProductId(Long productId);

    /**
     * 根据商品id集合查询商品
     * @param productIds
     * @return
     */
    List<DanmoShoppingProducts> selectDanmoShoppingProductsByProductIds(@Param("productIds") Long[] productIds);


    /**
     * 根据商品id和规格id查询商品
     * @param id
     * @param specificationsId
     */
}
